local QI = DailyIntake.QuestItems;
local Localize = DailyIntake.Localize;

--------------------------------------------------------------------------------
-- Dalaran cooking quests
--------------------------------------------------------------------------------

-- Add item: Empty Picnic Basket; http://www.wowhead.com/?item=43142
local function EmptyPicnicBasket()
    return not UnitOnTaxi("player")

        -- must have 4 x Rhino Dogs; http://www.wowhead.com/?item=34752
        and GetItemCount(34752) >= 4

        -- must have 4 x Wild Mustard; http://www.wowhead.com/?item=43143
        and GetItemCount(43143) >= 4;
end
QI.RegisterQuestItem(43142, QI.Priority.Lowest, EmptyPicnicBasket);

-- Add item: Stew Cookpot; http://www.wowhead.com/?item=43147
local function StewCookpot()
    return not UnitOnTaxi("player") ~= 1

        -- must have 4 x Chilled Meat; http://www.wowhead.com/?item=43013
        and GetItemCount(43013) >= 4

        -- must have 4 x Crystalsong Carrot; http://www.wowhead.com/?item=43148
        and GetItemCount(43148) >= 4;
end
QI.RegisterQuestItem(43147, QI.Priority.Lowest, StewCookpot);

-- Add item: Meatloaf Pan; http://www.wowhead.com/?item=43101
local function MeatloafPan()
    return

    	not UnitOnTaxi("player") and

      -- must have 2 x Chilled Meat; http://www.wowhead.com/?item=43013
      GetItemCount(43013) >= 2 and

      -- must have 4 x Infused Mushroom; http://www.wowhead.com/?item=43100
      GetItemCount(43100) >= 4 and

    	-- Infused Mushroom Meatloaf: http://www.wowhead.com/quest=13100 or http://www.wowhead.com/quest=13112
		not QI.QuestsAreDoneAndNotTaken(13100,13112)

end
QI.RegisterQuestItem(43101, QI.Priority.Normal, MeatloafPan);

-- Add item: Meatloaf Pan; http://www.wowhead.com/?item=43101
QI.RegisterQuestItem(43101, QI.Priority.Lowest, function()
    return

    	not UnitOnTaxi("player") and

    	-- Infused Mushroom Meatloaf: http://www.wowhead.com/quest=13100 or http://www.wowhead.com/quest=13112
		not QI.QuestsAreDoneAndNotTaken(13100,13112)
end);

-- Add item: Empty Cheese Serving Platter; http://www.wowhead.com/?item=43139
local function EmptyCheeseServingPlatter()
    return not UnitOnTaxi("player")

        -- must have 6 x Half Full Dalaran Wine Glass; http://www.wowhead.com/?item=43138
        and GetItemCount(43138) >= 6

        -- must have 1 x Aged Dalaran Limburger; http://www.wowhead.com/?item=43137
        and GetItemCount(43137) >= 1

        -- must not have comapleted the quest yet
        and not (QI.QuestIsDone(13103) or
                 QI.QuestIsDone(13115)
                 );

end
QI.RegisterQuestItem(43139, QI.Priority.Normal, EmptyCheeseServingPlatter);

-- Add item: Empty Cheese Serving Platter; http://www.wowhead.com/?item=43139
QI.RegisterQuestItem(43139, QI.Priority.Lowest, function()
    return
    	not UnitOnTaxi("player") and

    	-- In Dalaran
    	GetZoneText() == "Dalaran" and

		-- must not have comapleted the quest yet
		not QI.QuestsAreDoneAndNotTaken(13103, 13115)
end)


--------------------------------------------------------------------------------
-- Dalaran jewelcrafting quests
--------------------------------------------------------------------------------

-- Add item: Northern Ivory; http://www.wowhead.com/?item=42104
local function NorthernIvory()
    return not UnitOnTaxi("player")

        and ( -- We have the mats
        -- must have 1 x Chalcedony; http://www.wowhead.com/?item=36923
        (GetItemCount(36923) >= 1

        -- must have 1 x Shadow Crystal; http://www.wowhead.com/?item=36926
        and GetItemCount(36926) >= 1

        -- or we are in Dalaran
        ) or GetZoneText() == "Dalaran")
end
QI.RegisterQuestItem(42104, QI.Priority.Lowest, NorthernIvory);

-- Add item: Iron Dwarf Brooch; http://www.wowhead.com/?item=42105
local function IronDwarfBrooch()
    return not UnitOnTaxi("player")

        and ( -- We have the mats
        -- must have 1 x Huge Citrine; http://www.wowhead.com/?item=36929
        (GetItemCount(36929) >= 1

        -- must have 1 x Sun Crystal; http://www.wowhead.com/?item=36920
        and GetItemCount(36920) >= 1

        -- or we are in Dalaran
        ) or GetZoneText() == "Dalaran")
end
QI.RegisterQuestItem(42105, QI.Priority.Lowest, IronDwarfBrooch);

-- Add item: Proto Dragon Bone; http://www.wowhead.com/?item=42106
local function ProtoDragonBone()
    return not UnitOnTaxi("player")

        and ( -- We have the mats
        -- must have 1 x Huge Citrine; http://www.wowhead.com/?item=36929
        -- must have 1 x Sun Crystal; http://www.wowhead.com/?item=36920
        (GetItemCount(36920) >= 1

        -- must have 1 x Dark Jade; http://www.wowhead.com/?item=36932
        and GetItemCount(36932) >= 1

        -- or we are in Dalaran
        ) or GetZoneText() == "Dalaran")
end
QI.RegisterQuestItem(42106, QI.Priority.Lowest, ProtoDragonBone);

-- Add item: Elemental Armor Scrap; http://www.wowhead.com/?item=42107
local function ElementalArmorScrap()
    return not UnitOnTaxi("player")

        and ( -- We have the mats
        -- must have 1 x Bloodstone; http://www.wowhead.com/?item=36917
        (GetItemCount(36917) >= 1

        -- must have 1 x Huge Citrine; http://www.wowhead.com/?item=36929
        and GetItemCount(36929) >= 1

        -- or we are in Dalaran
        ) or GetZoneText() == "Dalaran")
end
QI.RegisterQuestItem(42107, QI.Priority.Lowest, ElementalArmorScrap);

-- Add item: Scourge Curio; http://www.wowhead.com/?item=42108
local function ScourgeCurio()
    return not UnitOnTaxi("player")

        and ( -- We have the mats
        -- must have 1 x Sun Crystal; http://www.wowhead.com/?item=36920
        (GetItemCount(36920) >= 1

        -- must have 1 x Shadow Crystal; http://www.wowhead.com/?item=36926
        and GetItemCount(36926) >= 1

        -- or we are in Dalaran
        ) or GetZoneText() == "Dalaran")
end
QI.RegisterQuestItem(42108, QI.Priority.Lowest, ScourgeCurio);

-- =============================================================
-- Added by LaoTseu
-- =============================================================

-- Add item: Vrykul Amulet; http://www.wowhead.com/?item=41989
QI.RegisterQuestItem(41989, QI.Priority.Lowest, function()
	return not UnitOnTaxi("player")

   and ( -- We have the mats
	-- must have 1 x Bloodstone; http://www.wowhead.com/?item=36917
	(GetItemCount(36917) >= 1

	-- must have 1 x Dark Jade; http://www.wowhead.com/?item=36932
	and GetItemCount(36932) >= 1

	-- or we are in Dalaran
	) or GetZoneText() == "Dalaran")
end);

-- Add item: Bloated Slippery Eel; http://www.wowhead.com/?item=45328
QI.RegisterQuestItem(45328, QI.Priority.Normal, function()
    return not UnitOnTaxi("player");

end);
